#ifndef __INCLUDE_OBJ_H__
#define __INCLUDE_OBJ_H__

#if !defined(__cplusplus)
#error C++ compiler required
#endif

#include "stdafx.h"
#include <objbase.h>

class dmsoft
{
private:
    IDispatch * obj;

public:
    dmsoft();
    ~dmsoft();

    CString Ver();
    long SetPath(const CString& path);
	CString Ocr(long x1, long y1, long x2, long y2, const CString& color, double sim);
	long FindStr(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, long * x, long * y);
	long GetResultCount(const CString& str);
	long GetResultPos(const CString& str, long index, long * x, long * y);
	long StrStr(const CString& s, const CString& str);
	long SendCommand(const CString& cmd);
    long UseDict(long index);
    CString GetBasePath();
	long SetDictPwd(const CString& pwd);
	CString OcrInFile(long x1, long y1, long x2, long y2, const CString& pic_name, const CString& color, double sim);
	long Capture(long x1, long y1, long x2, long y2, const CString& file_name);
    long KeyPress(long vk);
    long KeyDown(long vk);
    long KeyUp(long vk);
    long LeftClick();
    long RightClick();
    long MiddleClick();
    long LeftDoubleClick();
    long LeftDown();
    long LeftUp();
    long RightDown();
    long RightUp();
    long MoveTo(long x,long y);
    long MoveR(long rx,long ry);
    CString GetColor(long x,long y);
    CString GetColorBGR(long x,long y);
	CString RGB2BGR(const CString& rgb_color);
	CString BGR2RGB(const CString& bgr_color);
    long UnBindWindow();
	long CmpColor(long x, long y, const CString& color, double sim);
    long ClientToScreen(long hwnd,long * x,long * y);
    long ScreenToClient(long hwnd,long * x,long * y);
	long ShowScrMsg(long x1, long y1, long x2, long y2, const CString& msg, const CString& color);
    long SetMinRowGap(long row_gap);
    long SetMinColGap(long col_gap);
	long FindColor(long x1, long y1, long x2, long y2, const CString& color, double sim, long dir, long * x, long * y);
	CString FindColorEx(long x1, long y1, long x2, long y2, const CString& color, double sim, long dir);
    long SetWordLineHeight(long line_height);
    long SetWordGap(long word_gap);
    long SetRowGapNoDict(long row_gap);
    long SetColGapNoDict(long col_gap);
    long SetWordLineHeightNoDict(long line_height);
    long SetWordGapNoDict(long word_gap);
	long GetWordResultCount(const CString& str);
	long GetWordResultPos(const CString& str, long index, long * x, long * y);
	CString GetWordResultStr(const CString& str, long index);
	CString GetWords(long x1, long y1, long x2, long y2, const CString& color, double sim);
	CString GetWordsNoDict(long x1, long y1, long x2, long y2, const CString& color);
    long SetShowErrorMsg(long show);
    long GetClientSize(long hwnd,long * width,long * height);
    long MoveWindow(long hwnd,long x,long y);
    CString GetColorHSV(long x,long y);
    CString GetAveRGB(long x1,long y1,long x2,long y2);
    CString GetAveHSV(long x1,long y1,long x2,long y2);
    long GetForegroundWindow();
    long GetForegroundFocus();
    long GetMousePointWindow();
    long GetPointWindow(long x,long y);
	CString EnumWindow(long parent, const CString& title, const CString& class_name, long filter);
    long GetWindowState(long hwnd,long flag);
    long GetWindow(long hwnd,long flag);
    long GetSpecialWindow(long flag);
	long SetWindowText(long hwnd, const CString& text);
    long SetWindowSize(long hwnd,long width,long height);
    long GetWindowRect(long hwnd,long * x1,long * y1,long * x2,long * y2);
    CString GetWindowTitle(long hwnd);
    CString GetWindowClass(long hwnd);
    long SetWindowState(long hwnd,long flag);
    long CreateFoobarRect(long hwnd,long x,long y,long w,long h);
    long CreateFoobarRoundRect(long hwnd,long x,long y,long w,long h,long rw,long rh);
    long CreateFoobarEllipse(long hwnd,long x,long y,long w,long h);
	long CreateFoobarCustom(long hwnd, long x, long y, const CString& pic, const CString& trans_color, double sim);
	long FoobarFillRect(long hwnd, long x1, long y1, long x2, long y2, const CString& color);
	long FoobarDrawText(long hwnd, long x, long y, long w, long h, const CString& text, const CString& color, long align);
	long FoobarDrawPic(long hwnd, long x, long y, const CString& pic, const CString& trans_color);
    long FoobarUpdate(long hwnd);
    long FoobarLock(long hwnd);
    long FoobarUnlock(long hwnd);
	long FoobarSetFont(long hwnd, const CString& font_name, long size, long flag);
    long FoobarTextRect(long hwnd,long x,long y,long w,long h);
	long FoobarPrintText(long hwnd, const CString& text, const CString& color);
    long FoobarClearText(long hwnd);
    long FoobarTextLineGap(long hwnd,long gap);
	long Play(const CString& file_name);
    long FaqCapture(long x1,long y1,long x2,long y2,long quality,long delay,long time);
    long FaqRelease(long handle);
	CString FaqSend(const CString& server, long handle, long request_type, long time_out);
    long Beep(long fre,long delay);
    long FoobarClose(long hwnd);
    long MoveDD(long dx,long dy);
    long FaqGetSize(long handle);
	long LoadPic(const CString& pic_name);
	long FreePic(const CString& pic_name);
    long GetScreenData(long x1,long y1,long x2,long y2);
    long FreeScreenData(long handle);
    long WheelUp();
    long WheelDown();
	long SetMouseDelay(const CString& tpe, long delay);
	long SetKeypadDelay(const CString& tpe, long delay);
	CString GetEnv(long index, const CString& name);
	long SetEnv(long index, const CString& name, const CString& value);
	long SendString(long hwnd, const CString& str);
	long DelEnv(long index, const CString& name);
    CString GetPath();
	long SetDict(long index, const CString& dict_name);
	long FindPic(long x1, long y1, long x2, long y2, const CString& pic_name, const CString& delta_color, double sim, long dir, long * x, long * y);
	CString FindPicEx(long x1, long y1, long x2, long y2, const CString& pic_name, const CString& delta_color, double sim, long dir);
    long SetClientSize(long hwnd,long width,long height);
	long ReadInt(long hwnd, const CString& addr, long tpe);
	float ReadFloat(long hwnd, const CString& addr);
	double ReadDouble(long hwnd, const CString& addr);
	CString FindInt(long hwnd, const CString& addr_range, long int_value_min, long int_value_max, long tpe);
	CString FindFloat(long hwnd, const CString& addr_range, float float_value_min, float float_value_max);
	CString FindDouble(long hwnd, const CString& addr_range, double double_value_min, double double_value_max);
	CString FindString(long hwnd, const CString& addr_range, const CString& string_value, long tpe);
	long GetModuleBaseAddr(long hwnd, const CString& module_name);
    CString MoveToEx(long x,long y,long w,long h);
	CString MatchPicName(const CString& pic_name);
	long AddDict(long index, const CString& dict_info);
    long EnterCri();
    long LeaveCri();
	long WriteInt(long hwnd, const CString& addr, long tpe, long v);
	long WriteFloat(long hwnd, const CString& addr, float v);
	long WriteDouble(long hwnd, const CString& addr, double v);
	long WriteString(long hwnd, const CString& addr, long tpe, const CString& v);
	long AsmAdd(const CString& asm_ins);
    long AsmClear();
    long AsmCall(long hwnd,long mode);
	long FindMultiColor(long x1, long y1, long x2, long y2, const CString& first_color, const CString& offset_color, double sim, long dir, long * x, long * y);
	CString FindMultiColorEx(long x1, long y1, long x2, long y2, const CString& first_color, const CString& offset_color, double sim, long dir);
    CString AsmCode(long base_addr);
	CString Assemble(const CString& asm_code, long base_addr, long is_upper);
    long SetWindowTransparent(long hwnd,long v);
	CString ReadData(long hwnd, const CString& addr, long length);
	long WriteData(long hwnd, const CString& addr, const CString& data);
	CString FindData(long hwnd, const CString& addr_range, const CString& data);
	long SetPicPwd(const CString& pwd);
	long Log(const CString& info);
	CString FindStrE(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim);
	CString FindColorE(long x1, long y1, long x2, long y2, const CString& color, double sim, long dir);
	CString FindPicE(long x1, long y1, long x2, long y2, const CString& pic_name, const CString& delta_color, double sim, long dir);
	CString FindMultiColorE(long x1, long y1, long x2, long y2, const CString& first_color, const CString& offset_color, double sim, long dir);
    long SetExactOcr(long exact_ocr);
	CString ReadString(long hwnd, const CString& addr, long tpe, long length);
    long FoobarTextPrintDir(long hwnd,long dir);
	CString OcrEx(long x1, long y1, long x2, long y2, const CString& color, double sim);
	long SetDisplayInput(const CString& mode);
    long GetTime();
    long GetScreenWidth();
    long GetScreenHeight();
	long BindWindowEx(long hwnd, const CString& display, const CString& mouse, const CString& keypad, const CString& public_desc, long mode);
    CString GetDiskSerial();
	CString Md5(const CString& str);
    CString GetMac();
	long ActiveInputMethod(long hwnd, const CString& id);
	long CheckInputMethod(long hwnd, const CString& id);
	long FindInputMethod(const CString& id);
    long GetCursorPos(long * x,long * y);
	long BindWindow(long hwnd, const CString& display, const CString& mouse, const CString& keypad, long mode);
	long FindWindow(const CString& class_name, const CString& title_name);
    long GetScreenDepth();
    long SetScreen(long width,long height,long depth);
    long ExitOs(long tpe);
    CString GetDir(long tpe);
    long GetOsType();
	long FindWindowEx(long parent, const CString& class_name, const CString& title_name);
	long SetExportDict(long index, const CString& dict_name);
    CString GetCursorShape();
    long DownCpu(long rate);
    CString GetCursorSpot();
	long SendString2(long hwnd, const CString& str);
	long FaqPost(const CString& server, long handle, long request_type, long time_out);
    CString FaqFetch();
	CString FetchWord(long x1, long y1, long x2, long y2, const CString& color, const CString& word);
	long CaptureJpg(long x1, long y1, long x2, long y2, const CString& file_name, long quality);
	long FindStrWithFont(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, const CString& font_name, long font_size, long flag, long * x, long * y);
	CString FindStrWithFontE(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, const CString& font_name, long font_size, long flag);
	CString FindStrWithFontEx(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, const CString& font_name, long font_size, long flag);
	CString GetDictInfo(const CString& str, const CString& font_name, long font_size, long flag);
	long SaveDict(long index, const CString& file_name);
    long GetWindowProcessId(long hwnd);
    CString GetWindowProcessPath(long hwnd);
    long LockInput(long locks);
	CString GetPicSize(const CString& pic_name);
    long GetID();
	long CapturePng(long x1, long y1, long x2, long y2, const CString& file_name);
	long CaptureGif(long x1, long y1, long x2, long y2, const CString& file_name, long delay, long time);
	long ImageToBmp(const CString& pic_name, const CString& bmp_name);
	long FindStrFast(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, long * x, long * y);
	CString FindStrFastEx(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim);
	CString FindStrFastE(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim);
    long EnableDisplayDebug(long enable_debug);
	long CapturePre(const CString& file_name);
	long RegEx(const CString& code, const CString& Ver, const CString& ip);
    CString GetMachineCode();
	long SetClipboard(const CString& data);
    CString GetClipboard();
    long GetNowDict();
    long Is64Bit();
	long GetColorNum(long x1, long y1, long x2, long y2, const CString& color, double sim);
	CString EnumWindowByProcess(const CString& process_name, const CString& title, const CString& class_name, long filter);
    long GetDictCount(long index);
    long GetLastError();
    CString GetNetTime();
    long EnableGetColorByCapture(long en);
    long CheckUAC();
    long SetUAC(long uac);
    long DisableFontSmooth();
    long CheckFontSmooth();
    long SetDisplayAcceler(long level);
	long FindWindowByProcess(const CString& process_name, const CString& class_name, const CString& title_name);
	long FindWindowByProcessId(long process_id, const CString& class_name, const CString& title_name);
	CString ReadIni(const CString& section, const CString& key, const CString& file_name);
	long WriteIni(const CString& section, const CString& key, const CString& v, const CString& file_name);
	long RunApp(const CString& path, long mode);
    long delay(long mis);
	long FindWindowSuper(const CString& spec1, long flag1, long type1, const CString& spec2, long flag2, long type2);
	CString ExcludePos(const CString& all_pos, long tpe, long x1, long y1, long x2, long y2);
	CString FindNearestPos(const CString& all_pos, long tpe, long x, long y);
	CString SortPosDistance(const CString& all_pos, long tpe, long x, long y);
	long FindPicMem(long x1, long y1, long x2, long y2, const CString& pic_info, const CString& delta_color, double sim, long dir, long * x, long * y);
	CString FindPicMemEx(long x1, long y1, long x2, long y2, const CString& pic_info, const CString& delta_color, double sim, long dir);
	CString FindPicMemE(long x1, long y1, long x2, long y2, const CString& pic_info, const CString& delta_color, double sim, long dir);
	CString AppendPicAddr(const CString& pic_info, long addr, long size);
	long WriteFile(const CString& file_name, const CString& content);
    long Stop(long id);
    long SetDictMem(long index,long addr,long size);
    CString GetNetTimeSafe();
    long ForceUnBindWindow(long hwnd);
	CString ReadIniPwd(const CString& section, const CString& key, const CString& file_name, const CString& pwd);
	long WriteIniPwd(const CString& section, const CString& key, const CString& v, const CString& file_name, const CString& pwd);
	long DecodeFile(const CString& file_name, const CString& pwd);
	long KeyDownChar(const CString& key_str);
	long KeyUpChar(const CString& key_str);
	long KeyPressChar(const CString& key_str);
	long KeyPressStr(const CString& key_str, long delay);
    long EnableKeypadPatch(long en);
    long EnableKeypadSync(long en,long time_out);
    long EnableMouseSync(long en,long time_out);
	long DmGuard(long en, const CString& tpe);
	long FaqCaptureFromFile(long x1, long y1, long x2, long y2, const CString& file_name, long quality);
	CString FindIntEx(long hwnd, const CString& addr_range, long int_value_min, long int_value_max, long tpe, long steps, long multi_thread, long mode);
	CString FindFloatEx(long hwnd, const CString& addr_range, float float_value_min, float float_value_max, long steps, long multi_thread, long mode);
	CString FindDoubleEx(long hwnd, const CString& addr_range, double double_value_min, double double_value_max, long steps, long multi_thread, long mode);
	CString FindStringEx(long hwnd, const CString& addr_range, const CString& string_value, long tpe, long steps, long multi_thread, long mode);
	CString FindDataEx(long hwnd, const CString& addr_range, const CString& data, long steps, long multi_thread, long mode);
    long EnableRealMouse(long en,long mousedelay,long mousestep);
    long EnableRealKeypad(long en);
	long SendStringIme(const CString& str);
	long FoobarDrawLine(long hwnd, long x1, long y1, long x2, long y2, const CString& color, long style, long width);
	CString FindStrEx(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim);
    long IsBind(long hwnd);
    long SetDisplayDelay(long t);
    long GetDmCount();
    long DisableScreenSave();
    long DisablePowerSave();
    long SetMemoryHwndAsProcessId(long en);
	long FindShape(long x1, long y1, long x2, long y2, const CString& offset_color, double sim, long dir, long * x, long * y);
	CString FindShapeE(long x1, long y1, long x2, long y2, const CString& offset_color, double sim, long dir);
	CString FindShapeEx(long x1, long y1, long x2, long y2, const CString& offset_color, double sim, long dir);
	CString FindStrS(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, long * x, long * y);
	CString FindStrExS(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim);
	CString FindStrFastS(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim, long * x, long * y);
	CString FindStrFastExS(long x1, long y1, long x2, long y2, const CString& str, const CString& color, double sim);
	CString FindPicS(long x1, long y1, long x2, long y2, const CString& pic_name, const CString& delta_color, double sim, long dir, long * x, long * y);
	CString FindPicExS(long x1, long y1, long x2, long y2, const CString& pic_name, const CString& delta_color, double sim, long dir);
    long ClearDict(long index);
    CString GetMachineCodeNoMac();
    long GetClientRect(long hwnd,long * x1,long * y1,long * x2,long * y2);
    long EnableFakeActive(long en);
    long GetScreenDataBmp(long x1,long y1,long x2,long y2,long * data,long * size);
	long EncodeFile(const CString& file_name, const CString& pwd);
    CString GetCursorShapeEx(long tpe);
    long FaqCancel();
    CString IntToData(long int_value,long tpe);
    CString FloatToData(float float_value);
    CString DoubleToData(double double_value);
	CString StringToData(const CString& string_value, long tpe);
	long SetMemoryFindResultToFile(const CString& file_name);
    long EnableBind(long en);
    long SetSimMode(long mode);
    long LockMouseRect(long x1,long y1,long x2,long y2);
    long SendPaste(long hwnd);
    long IsDisplayDead(long x1,long y1,long x2,long y2,long t);
    long GetKeyState(long vk);
	long CopyFile(const CString& src_file, const CString& dst_file, long over);
	long IsFileExist(const CString& file_name);
	long DeleteFile(const CString& file_name);
	long MoveFile(const CString& src_file, const CString& dst_file);
	long CreateFolder(const CString& folder_name);
	long DeleteFolder(const CString& folder_name);
	long GetFileLength(const CString& file_name);
	CString ReadFile(const CString& file_name);
    long WaitKey(long key_code,long time_out);
	long DeleteIni(const CString& section, const CString& key, const CString& file_name);
	long DeleteIniPwd(const CString& section, const CString& key, const CString& file_name, const CString& pwd);
    long EnableSpeedDx(long en);
    long EnableIme(long en);
	long Reg(const CString& code, const CString& Ver);
    CString SelectFile();
    CString SelectDirectory();
    long LockDisplay(long locks);
	long FoobarSetSave(long hwnd, const CString& file_name, long en, const CString& header);
	CString EnumWindowSuper(const CString& spec1, long flag1, long type1, const CString& spec2, long flag2, long type2, long sort);
	long DownloadFile(const CString& url, const CString& save_file, long timeout);
    long EnableKeypadMsg(long en);
    long EnableMouseMsg(long en);
	long RegNoMac(const CString& code, const CString& Ver);
	long RegExNoMac(const CString& code, const CString& Ver, const CString& ip);
    long SetEnumWindowDelay(long delay);
	long FindMulColor(long x1, long y1, long x2, long y2, const CString& color, double sim);
    CString GetDict(long index,long font_index);
    long GetBindWindow();
	long FoobarStartGif(long hwnd, long x, long y, const CString& pic_name, long repeat_limit, long delay);
	long FoobarStopGif(long hwnd, long x, long y, const CString& pic_name);
    long FreeProcessMemory(long hwnd);
	CString ReadFileData(const CString& file_name, long start_pos, long end_pos);
    long VirtualAllocEx(long hwnd,long addr,long size,long tpe);
    long VirtualFreeEx(long hwnd,long addr);
    CString GetCommandLine(long hwnd);
    long TerminateProcess(long pid);
	CString GetNetTimeByIp(const CString& ip);
	CString EnumProcess(const CString& name);
    CString GetProcessInfo(long pid);
    long ReadIntAddr(long hwnd,long addr,long tpe);
    CString ReadDataAddr(long hwnd,long addr,long length);
    double ReadDoubleAddr(long hwnd,long addr);
    float ReadFloatAddr(long hwnd,long addr);
    CString ReadStringAddr(long hwnd,long addr,long tpe,long length);
	long WriteDataAddr(long hwnd, long addr, const CString& data);
    long WriteDoubleAddr(long hwnd,long addr,double v);
    long WriteFloatAddr(long hwnd,long addr,float v);
    long WriteIntAddr(long hwnd,long addr,long tpe,long v);
	long WriteStringAddr(long hwnd, long addr, long tpe, const CString& v);
    long Delays(long min_s,long max_s);
	long FindColorBlock(long x1, long y1, long x2, long y2, const CString& color, double sim, long count, long width, long height, long * x, long * y);
	CString FindColorBlockEx(long x1, long y1, long x2, long y2, const CString& color, double sim, long count, long width, long height);
    long OpenProcess(long pid);
	CString EnumIniSection(const CString& file_name);
	CString EnumIniSectionPwd(const CString& file_name, const CString& pwd);
	CString EnumIniKey(const CString& section, const CString& file_name);
	CString EnumIniKeyPwd(const CString& section, const CString& file_name, const CString& pwd);
    long SwitchBindWindow(long hwnd);
    long InitCri();
	long SendStringIme2(long hwnd, const CString& str, long mode);
	CString EnumWindowByProcessId(long pid, const CString& title, const CString& class_name, long filter);
    CString GetDisplayInfo();
    long EnableFontSmooth();
	CString OcrExOne(long x1, long y1, long x2, long y2, const CString& color, double sim);
    long SetAero(long en);
	long FoobarSetTrans(long hwnd, long trans, const CString& color, double sim);
    long EnablePicCache(long en);
	CString GetInfo(const CString& cmd, const CString& param);
    long FaqIsPosted();
	long LoadPicByte(long addr, long size, const CString& name);
    long MiddleDown();
    long MiddleUp();
	long FaqCaptureString(const CString& str);
    long VirtualProtectEx(long hwnd,long addr,long size,long tpe,long old_protect);
    long SetMouseSpeed(long speed);
    long GetMouseSpeed();
    long EnableMouseAccuracy(long en);
};

#endif
